#include "UdpServer.hpp"
#include <memory>
#include "RouteMessage.hpp"

void Usage(string proc)
{
    cout << "Usage: " << proc << "+port" << endl;
}
int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t serverport = stoi(argv[1]);
    RouteMessage rou;

    func_t roume = bind(&RouteMessage::Route, &rou, placeholders::_1, placeholders::_2, placeholders::_3);
    unique_ptr<UdpServer> upds = make_unique<UdpServer>(serverport, roume);
    upds->InitServer();
    upds->Start();

    return 0;
}